package com.javasm.commons.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@ConfigurationProperties(prefix = "crm")
public class CrmProperties {
    private static String root;
    private static LoginToken loginToken;
    private static ResetPwdToken resetpwdToken;
    private static Cors cors;
    private static Sms sms;
    private static Oss oss;

    public static Oss getOss() {
        return oss;
    }

    public void setOss(Oss oss) {
        CrmProperties.oss = oss;
    }

    public static ResetPwdToken getResetpwdToken() {
        return resetpwdToken;
    }

    public void setResetpwdToken(ResetPwdToken resetpwdToken) {
        CrmProperties.resetpwdToken = resetpwdToken;
    }

    public static Sms getSms() {
        return sms;
    }

    public void setSms(Sms sms) {
        CrmProperties.sms = sms;
    }

    public static Cors getCors() {
        return cors;
    }

    public void setCors(Cors cors) {
        CrmProperties.cors = cors;
    }

    public static String getRoot() {
        return root;
    }

    public void setRoot(String root) {
        this.root = root;
    }

    public static LoginToken getLoginToken() {
        return loginToken;
    }

    public void setLoginToken(LoginToken loginToken) {
        this.loginToken = loginToken;
    }

    public static class Oss{
        private String endpoint="https://oss-cn-hangzhou.aliyuncs.com";
        private String accessKeyId;
        private String accessKeySecret;
        private String standBuckName;

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getAccessKeyId() {
            return accessKeyId;
        }

        public void setAccessKeyId(String accessKeyId) {
            this.accessKeyId = accessKeyId;
        }

        public String getAccessKeySecret() {
            return accessKeySecret;
        }

        public void setAccessKeySecret(String accessKeySecret) {
            this.accessKeySecret = accessKeySecret;
        }

        public String getStandBuckName() {
            return standBuckName;
        }

        public void setStandBuckName(String standBuckName) {
            this.standBuckName = standBuckName;
        }
    }
    public static class Sms{
        private String keyid;
        private String keySecret;
        private String signName;
        private String templateCode;

        public String getKeyid() {
            return keyid;
        }

        public void setKeyid(String keyid) {
            this.keyid = keyid;
        }

        public String getKeySecret() {
            return keySecret;
        }

        public void setKeySecret(String keySecret) {
            this.keySecret = keySecret;
        }

        public String getSignName() {
            return signName;
        }

        public void setSignName(String signName) {
            this.signName = signName;
        }

        public String getTemplateCode() {
            return templateCode;
        }

        public void setTemplateCode(String templateCode) {
            this.templateCode = templateCode;
        }
    }
    public static class Cors{
        private String path="/**";
        private List<String> allowedOrigins;
        private List<String> allowedHeaders;
        private List<String> allowedMethods;
        private List<String> exposedHeaders;
        private Long maxAge;
        private Boolean allowCredentials;

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public List<String> getAllowedOrigins() {
            return allowedOrigins;
        }

        public void setAllowedOrigins(List<String> allowedOrigins) {
            this.allowedOrigins = allowedOrigins;
        }

        public List<String> getAllowedHeaders() {
            return allowedHeaders;
        }

        public void setAllowedHeaders(List<String> allowedHeaders) {
            this.allowedHeaders = allowedHeaders;
        }

        public List<String> getAllowedMethods() {
            return allowedMethods;
        }

        public void setAllowedMethods(List<String> allowedMethods) {
            this.allowedMethods = allowedMethods;
        }

        public List<String> getExposedHeaders() {
            return exposedHeaders;
        }

        public void setExposedHeaders(List<String> exposedHeaders) {
            this.exposedHeaders = exposedHeaders;
        }

        public Long getMaxAge() {
            return maxAge;
        }

        public void setMaxAge(Long maxAge) {
            this.maxAge = maxAge;
        }

        public Boolean getAllowCredentials() {
            return allowCredentials;
        }

        public void setAllowCredentials(Boolean allowCredentials) {
            this.allowCredentials = allowCredentials;
        }
    }
    public static class LoginToken{
        private String key;
        private String expireTime;

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getExpireTime() {
            return expireTime;
        }

        public void setExpireTime(String expireTime) {
            this.expireTime = expireTime;
        }
    }
    public static class ResetPwdToken{
        private String key;
        private Long expireTime;

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public Long getExpireTime() {
            return expireTime;
        }

        public void setExpireTime(Long expireTime) {
            this.expireTime = expireTime;
        }
    }
}
